import { Button } from 'flowbite-react'
import { FaBook } from 'react-icons/fa'

export default function StudyComplete({ onReturn }) {
    // 触发自定义事件
    const handleReturn = () => {
      // 触发学习完成事件
      const event = new CustomEvent('studyComplete')
      window.dispatchEvent(event)
      onReturn()
    }
  
  return (
    <div className="text-center py-12">
      <div className="text-6xl text-gray-400 mb-4">
        <FaBook className="mx-auto" />
      </div>
      <h2 className="text-2xl font-bold text-gray-900 mb-4">太棒了！</h2>
      <p className="text-gray-600 mb-8">您已完成今天的所有复习任务</p>
      <Button color="gray" onClick={handleReturn}>返回选择</Button>
    </div>
  )
}